{% extends "rudiment_index.html" %}
{% load staticfiles %}
{% load tz %}
{% block breadcrumb %}机房管理
<span style="margin-left: 50px"></span>
<a class="btn btn-sm  btn-primary "
               href="/cmdb/asset_info"    style="line-height:10px; text-align:center; color: white"> 资产管理 <span class="glyphicon glyphicon-wrench"></span></a>
<span style="margin-left: 1px"></span>
<a class="btn btn-sm  btn-primary "
               href="/cmdb/idc_info"  style="line-height:10px; text-align:center; color: white"> 机房管理 <span class="glyphicon glyphicon-asterisk"></span></a>
<span style="margin-left: 1px"></span>
<a class="btn btn-sm  btn-primary "
               href="/cmdb/group_connect"  style="line-height:10px; text-align:center; color: white"> 属组管理 <span class="glyphicon glyphicon-tags"></span></a>


{% endblock %}




{% block content %}


   <div class="row">
          <div class="col-sm-2" style="padding-left: 0">
                 <a class="btn   btn-success"
               href="/cmdb/idc_add">
                添加机房信息
            </a>
          </div>

          <div id="add" class="modal hide fade " tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <span class="glyphicon glyphicon-fullscreen"></span>
                <span class="close" data-dismiss="modal" aria-hidden="true"><i class="glyphicon glyphicon-remove "></i></span>

                <h3>对话框标题</h3>
            </div>
            <div class="modal-body" style="overflow:scroll"></div>

        </div>

        <div id="edit" class="modal hide fade " tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <span class="glyphicon glyphicon-fullscreen"></span>
                <span class="close" data-dismiss="modal" aria-hidden="true"><i class="glyphicon glyphicon-remove "></i></span>

                <h3>对话框标题</h3>
            </div>
            <div class="modal-body" style="overflow:scroll"></div>

        </div>

       <div id="idc_del" class="modal hide fade " tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <span class="glyphicon glyphicon-fullscreen"></span>
                <span class="close" data-dismiss="modal" aria-hidden="true"><i class="glyphicon glyphicon-remove "></i></span>

                <h3>对话框标题</h3>
            </div>
            <div class="modal-body" style="overflow:scroll"></div>

        </div>


        <form class="form form-inline" action="" method="post">







                    <div class="col-sm-4" style="padding-right: 0;">
                             <div class="input-group inline-group padding-right: 10px">
                                <input type="text" class="form-control m-b "  name="keyword" value="{{ keyword }}" placeholder="Search">
                                <input type="text" style="display: none">
                                <div class="input-group-btn ">

                                    <a id='btnSearch' href="/docker/image_delete?imagede={{ item.id }}" style="text-decoration:none;margin-left: 5px" class="btn btn-primary ">
                                        <b>&nbsp;搜索&nbsp;</b>
                                    </a>
                                </div>
                            </div>
                        </div>
        </form>
   </div>



                <div class="box-body" style="margin-top: 10px">
                  <table class="table table-striped table-bordered" id="dataform">
                      <thead>
                        <tr>
                            <th>
                                <input id="checkall" type="checkbox" class="i-checks" name="checkall" value="checkall" data-editable='false' onclick="check_all('asset_form')">
                            </th>
                                    <th>机房名称</th>
                                    <th>机房地址</th>
                                    <th>机房标识</th>
                                    <th>机房负责人</th>
                                    <th>机房电话</th>
                                    <th>移动电话</th>
                                    <th>IP范围</th>
                                    <th>带宽</th>
                                    <th>备注</th>

                                    <!--<th>机房</th>-->

                                    <th class="text-center">功能</th>
                                </tr>
                            </thead>
                            <tbody>


                                    {% for idc in idc_infos %}
                                    <tr class="even gradeX">
                                        <td><input type="checkbox" id="id" class="i-checks" value="{{ idc.id }}" name="id" /></td>
                                        <td><a class="" modal-title="机房信息" data-target="#show" data-toggle="modal"
                                                                              data-height="550" data-width="580"
                                                                              href="/cmdb/idc_show?idcn={{idc.name}}"><li style="list-style-type:none"  value="{{ idc.name }}"> {{ idc.name }}</li></a></td>

                                        <td>{{ idc.address}}</td>
                                        <td>{{ idc.ids}}</td>
                                        <td>{{ idc.contact}}</td>
                                        <td>{{ idc.contact_phone}}</td>
                                        <td>{{ idc.tel}}</td>
                                        <td>{{ idc.ip_range}}</td>
                                        <td>{{ idc.bandwidth}}</td>
                                        <td>{{ idc.memo}}</td>


                                        <td class="text-center" data-editable='false'>

                                             <a class="btn btn-sm  btn-primary glyphicon glyphicon-wrench" modal-title="编辑机房" data-target="#edit" data-toggle="modal" data-height="550" data-width="580"
               href="/cmdb/idc_edit?id={{idc.id}}">

            </a>



                                        <a  class="btn btn-sm  btn-danger  glyphicon glyphicon-remove asset_del" modal-title="删除机房" data-target="#idc_del" data-toggle="modal" data-height="150" data-width="400"
               href="/cmdb/idc_del?id={{idc.id}}">

            </a>

                                    </td>
                                    </tr>
                                {% endfor %}


                            </tbody>
                  </table>


        <ul class="pagination" id="pager">
        {% if assets_infos.has_previous %}
            <li class="previous"><a href="/cmdb/asset_info/?page={{ assets_infos.previous_page_number }}">上一页</a></li>
        {% else %}
            <li class="previous disabled"><a href="#">上一页</a></li>
        {% endif %}
        {% for num in paginator.page_range %}
            {% if num == currentPage %}
                <li class="item active"><a href="/cmdb/asset_info/?page={{ num }}">{{ num }}</a></li>
            {% else %}
                <li class="item"><a href="/cmdb/asset_info/?page={{ num }}">{{ num }}</a></li>
            {% endif %}
        {% endfor %}
        {% if assets_infos.has_next %}
            <li class="next"><a href="/cmdb/asset_info/?page={{ assets_infos.next_page_number }}">下一页</a></li>
        {% else %}
            <li class="next disabled"><a href="#">下一页</a></li>
        {% endif %}
    </ul>

      <div id="asset_del" class="modal hide fade " tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <span class="glyphicon glyphicon-fullscreen"></span>
                <span class="close" data-dismiss="modal" aria-hidden="true"><i class="glyphicon glyphicon-remove "></i></span>

                <h3>对话框标题</h3>
            </div>
            <div class="modal-body"></div>
        </div>


          <div id="show" class="modal hide fade " tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <span class="glyphicon glyphicon-fullscreen"></span>
                <span class="close" data-dismiss="modal" aria-hidden="true"><i class="glyphicon glyphicon-remove "></i></span>

                <h3>对话框标题</h3>
            </div>
            <div class="modal-body"></div>
        </div>


                    <!--<script>-->

                        <!--$("#idc_del").click(function(){-->
                            <!--var idc_id = $("#idc_del").attr("")-->
                            <!--alert()-->
                        <!--})-->


                    <!--</script>-->

{% endblock %}